<template>
  <div class="page">
    <headerbar>驻村辅导</headerbar>

    <section class="frame-content-sub bg-default">
      <workVillageMenu></workVillageMenu>
      <div class="bg-white pdv-5 pdh-5">
        <div class="color-tip pdh-3">
          本部门共收到问题 <span class="color-red pdh-1">{{data.replyNum}}</span>个 <span class="pdh-1"></span> 答复<span class="color-red pdh-1">{{data.doReplyNum}}</span>个
        </div>

        <div class="mgt-3">
          <span class="color-tip pdh-3">回复率 <span class="color-red">{{data.replyRate}}</span></span><span
          class="color-tip pdh-3">满意率 <span class="color-red">{{data.pleasedRate}}</span></span>
        </div>
      </div>

      <div class="pdv-1"></div>

      <div id="newQa" class="mui-active">
        <div class="d-scroll list-phone" style="">
          <div class="text-center no-data" v-if="swipeData.length===0">
            <img src="../../../../static/images/no_data.png" alt="">
            <p>暂无数据</p>
          </div>
          <div class="item" v-for="(data,index) in swipeData">
            <div class="avatar">
              <img src="../../../../static/images/dangjian/home/img-load-error.jpg" alt="">
            </div>
            <div class="text-wrap">
              <div class="flex">
                <div>
                  <span class="title">{{data.coachTeacherName}}</span> <span class="pdh-2 color-tip tip">委员</span>
                </div>
                <a type="phone" class="color-green">{{data.telephone}}</a>
              </div>

              <div class="mgt-2 flex tip color-tip">

                          <span>
                            应答
                            <span class="color-red">{{data.replyNum}}</span>
                            个
                          </span>
                <span>
                            未答
                            <span class="color-red">{{data.noReplyNum}}</span>
                            个
                          </span>
                <span>
                            答复率
                            <span class="color-red">{{data.replyRate}}</span>
                          </span>

              </div>

            </div>
          </div>

        </div>
      </div>
    </section>
  </div>
</template>

<script>
  import tools from '@/utils/tools'
  import workVillageMenu from '@/components/common/workVillageMenu'
  import api from '@/common/config/api'
  import loginService from '@/service/loginService'
  import moment from 'moment'
  export default {
    components: {workVillageMenu},
    name: 'tutoringVillage',
    data () {
      return {
        fn: tools,
        swipeData: [],
        infinite: true,
        pageIndex: 1,
        data: {},
        userGroup: {}
      }
    },
    created () {
      this.userGroup = this.$store.state.userGroup
      this.loadData()
      this.loadListData()
    },
    methods: {
      loadData () {
        let data = {
          deptId: this.userGroup.groupId
        }
        loginService.coachDeptInfo(data).then((res) => {
          if (res.code !== 0) {
            return tools.tip(res.message)
          }
          this.data = res.data
        })
      },
      loadListData () {
        let data = {
          deptId: this.userGroup.groupId
        }
        loginService.coachTeacherInfo(data).then((res) => {
          if (res.code !== 0) {
            return tools.tip(res.message)
          }
          this.swipeData = res.data
        })
      },
      getTime (createTime) {
        return moment(createTime).format('YYYY-MM-DD')
      }
    }
  }
</script>

<style scoped lang="">

</style>


